function serializeToJson(form) {
    var result = {};
    //获得表单中用户输入的内容，返回数组0: {name: "email", value: "3467887@163.com"}
    // 1: {name: "password", value: "123412314"}
    var f = form.serializeArray();
    f.forEach(function(item) {
        //相当于这个写法result.email=item.value
        result[item.name] = item.value;
    });
    return result;
}